#include <stdio.h>

void insertion_sort(int arr[], int len)
{
    int i, j, temp;
    for (i = 1; i < len; i++) {
        temp = arr[i];
        for (j = i; j > 0 && arr[j - 1] > temp; j--) {
            arr[j] = arr[j - 1];
        }
        arr[j] = temp;
    }
}

int main()
{
    int arr[10] = { 20, 30, 3, 40, 60, 80, 50, 70, 90, 0};
    int len = 10;
    int i = 0;

    insertion_sort(arr, len);

    for (i = 0; i < len; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");

    return 0;
}
